<style lang="css"></style>
<template>
  {{ emps }}
</template>
<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import type { Emp } from './type';
import { list, listId, updateEmp } from './api/emp';

const emps: any[] = reactive<Emp[]>([])

onMounted(() => {
  list().then((data: Emp[]) => {
    data.forEach(emp => emps.push(emp));
  });

  listId("8197fb45-2b60-4309-820c-e70824fc9b33").then((data: Emp) => {
    console.log(data);
  })

  updateEmp("8197fb45-2b60-4309-820c-e70824fc9b33", { age: 300 }).then((data: any) => {
    console.log(data);
  })
});


</script>